import requests


def get_header():
    url = "https://ihrm2-test.itheima.net/api/sys/login"
    data = {"mobile": "13800000002", "password": "888itcast.CN764%..."}
    resp = requests.post(url=url,json=data)
    #print(resp.json())
    #从响应体中提取data，得到令牌
    token = resp.json().get("data")
    header = {"Content-Type": "application/json", "Authorization": "Bearer "+token}
    return header


if __name__ == '__main__':
    get_header()
